#ifndef __SCREEN_H__
#define __SCREEN_H__

#include <list>

#include <GL/glut.h>

#include "Drawable.h"
#include "Updatable.h"
#include "Timer.h"

/*
 * Classe: Screen
 *
 *   Interface para tela de jogo
 *
*/

class Screen
{
      private:
        int mode;

        std::list<Drawable *> * drawableObjects;
        std::list<Updatable *> * updatableObjects;      
      protected:
        void updateAll(double dt);
        void drawAll();
        
        void addUpdatable(Updatable * u) { updatableObjects->push_back(u); }
        void addUpdatable(std::list<Updatable *> &l);
        void addDrawable(Drawable * d) { drawableObjects->push_back(d); }
        void addDrawable(std::list<Drawable *> &l);
        
        double lt;
      public:
        enum screenModes { SCREEN_2D, SCREEN_3D };
        
        Screen(int newMode);
        ~Screen();
        
        int getMode() { return mode; }
        
        void setup(int width, int height);
        void cleanup();
        virtual void display();
        
        void registerTimer(Timer * t) { updatableObjects->push_back(t); }
        
        virtual void processKey(unsigned char key, int x, int y);
        virtual void processFuncKeyDown(int key, int x1, int y1) {}
        virtual void processFuncKeyUp(int key, int x, int y) {}
};

#endif
